import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import template from './modules/template';

const notFound = () => import('@/views/404NotFound.vue');

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: '/',
    component: () => import('@/layout/default.vue'),
    children: [
      {
        path: '/monitoring',
        name: 'monitoring',
        component: () => import('@/views/monitoring.vue'),
      },
      template
    ],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/layout/login.vue'),
  },
  { path: '/404', name: '404', component: notFound },
  {
    path: '/:pathMatch(.*)*',
    name: 'not-found',
    redirect: '/404',
    component: notFound,
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
